xen/arm: Correctly support WARN_ON
authorJulien Grall <julien.grall@linaro.org>
Tue, 30 Sep 2014 16:58:05 +0000 (17:58 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 1 Oct 2014 11:09:50 +0000 (12:09 +0100)
commit3e802c6ca1fb9a9549258c2855a57cad483f3cbd
treecb019107436e1b4aec91d8c4c2e2c4503c19058a
parentbc8e20414aeacdb23d183793c1d947e28c26685b
xen/arm: Correctly support WARN_ON

Currently the hypervisor will hang if it hits a WARN_ON.

The implementation uses an undefined instruction, made ourself because ARM
don't provide one, to implement BUG/ASSERT/WARN_ON, and sets up the
different tables (one for each type) which contain useful information.

This is based on the x86 implementation (include/asm-x86/bug.h). Unfortunately
the structure can't be shared because many ARM{32,64} gcc versions doesn't
correctly support %c. The support for executing a function in an exception handler
is also keep unimplemented on ARM. Therefore, dump_execution_state is
implemented as WARN()

The current opcode used to go in exception mode may not be undefined on ARM64.
Use the instruction "brk" to generate a software debug exception.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/arm32/traps.c
xen/arch/arm/traps.c
xen/arch/arm/xen.lds.S
xen/include/asm-arm/arm32/bug.h [new file with mode: 0644]
xen/include/asm-arm/arm64/bug.h [new file with mode: 0644]
xen/include/asm-arm/bug.h
xen/include/asm-arm/debugger.h
xen/include/asm-arm/processor.h